package com.itheima;

import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/*
    共同点：都可以声明是一个客户端
    @EnableDiscoveryClient：eureka/zk
    @EnableEurekaClient: 只针对eureka客户端生效
 */
/*@SpringBootApplication
@EnableEurekaClient //声明是一个客户端
@EnableCircuitBreaker //开启熔断器*/
@SpringCloudApplication
@EnableHystrixDashboard //开启仪表盘监控
public class ConsumerServiceApplication {

    public static void main(String[] args) {
        SpringApplication.run(ConsumerServiceApplication.class, args);
    }

    @Bean
    @LoadBalanced //开启负载均衡 --》启用Ribbon
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }

}
